<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><{config_item('website_title')}></title>
    <meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <link rel="stylesheet" href="/views/default/skin/css/swiper.min.css">
    <link rel="stylesheet" href="/views/default/skin/css/style.css">
</head>
<body>
<!-- search start -->
<section class="searchwrap flexbox">
    <div class="logbox flexbox">
        <img src="/views/default/skin/images/logo.png">
    </div>
    <div class="searchbox flexbox">
        <input type="text" class="searchstyle" placeholder="搜索商品">
        <div class="searchbtnbox">
            <img src="/views/default/skin/images/search_btn.png">
        </div>
    </div>
</section>
<!-- search end -->
<section class="contentbox ">
    <!-- leftnav start -->
    <aside class="nav" id="left_category_list">
        <a href="<{site_url('/web/category')}>" class="nav_a {{if $value.id==''}}activea{{/if}}">推荐</a>
    </aside>
    <!--左侧分类模板start-->
    <script type='text/html' id='left_category_list_Template'>
        {{each result}}
        <a href="<{site_url('/web/category?cat_id={{$value.id}}')}>" class="nav_a {{if $value.id=='<{$category.id}>'}}activea{{/if}}">{{$value.name}}</a>
        {{/each}}
    </script>
    <!--左侧分类模板end-->
    <!-- leftnav end -->
    <!--分类列表 start  -->
    <section class="prolist" id="category_list">
    </section>
    <!--分类模板start-->
    <script type='text/html' id='category_list_Template'>
        {{each result}}
        <a href="<{site_url('/web/goods/goods_list?cat_id={{$value.id}}')}>" class="gridsitem_a2">
            <div class="sortImgwrap">
                <img src="{{$value.image}}">
            </div>
            <p class="gridsitem_label">{{$value.name}}</p>
        </a>
        {{/each}}
    </script>
    <!--分类模板end-->
    <!--分类列表 end -->
</section>
<script type="text/javascript" src="/public/js/jquery.js"></script>
<script type="text/javascript" src="/public/js/artTemplate.js"></script>
<script type="text/javascript" src="/views/default/skin/js/swiper.min.js"></script>
<script type="text/javascript" src="/views/default/skin/js/public.js"></script>
<{include file="default/footer.html"}>
<script>
    //左侧分类展示start
    $(function(){
        //左侧分类展示
        category(0,'left_category_list','');
        <{if $category.id!=''}>
            //右侧分类展示
            category(<{$category.id}>,'category_list','');
        <{else}>
            //默认推荐的
            category(0,'category_list','<{site_url('/api/goods/category/flag_list')}>');
        <{/if}>
    })

    //分类请求
    function category(cat_id,div_id,post_url){
        if (post_url == '') {
            post_url = '<{site_url('/api/goods/category/')}>';
        }
        $.ajax({
            type:"POST",
            url: post_url,
            data: 'reid='+cat_id,
            dataType:"json",
            success: function(data){
                if (data.status=='y') {
                    var html = template(div_id+'_Template',data);
                    $('#'+div_id).html(html);
                }
            }
        });
    }
</script>
<script>
    window.onload = function () {
        // 设置左侧导航栏高度
        var headerHeight = $(".searchwrap").height();
        var footerHeight = $(".navbar").height();
        var navHeight = (window.innerHeight - headerHeight - footerHeight) + 'px';
        // var assortHeight  = (window.innerHeight - headerHeight - footerHeight-20) +'px' ;
        $('.nav').css("height", navHeight);
    }
</script>
<{include file="default/wechat_share.html"}>
<script language="JavaScript">
    wx.ready(function(){
        var share_title  = "<{config_item('website_title')}>";
        var share_desc   = "";
        var share_link   = "<{site_url('/web')}>";
        var share_imgurl = "<{config_item('base_url')}><{config_item('website_logo')}>";
        wx_share(share_title, share_desc, share_link, share_imgurl);
    });
</script>
</body>
</html>




